# Medical Image Segmentation Transformer: MIST for Left Atrium Segmentation

## Directory Structure
```
model_MIST/
├── lib/
    ├── models_timm/ # Vision transformer backbone and layers
        ├── convnext.py
        ├── maxxvit.py 
        ├── vision_transformer_relpos.py 
        ├── ... 
        └── layers/  # Additional layers for model
            ├── cbam.py # Attention layers
            ├── conv2d_same.py 
            ├── ...
            └── norm.py
    ├── maxxvit_4out.py # Custom output configuration
    ├── MIST.py # Main MIST model
    └── networks.py # Network wrapper  
├── dataset_synapse.py # Dataset loader
├── train.py # Training script
├── trainer.py # Training helper (loop, logging, etc.)
├── eval.py # Evaluation script
├── utils.py # Utility functions
└── README.md
```

## How to Run
### Training
```bash
python train.py --config configs/unet_config.yaml
```
### Evaluation
```bash
python eval.py --checkpoint checkpoints/best_unet.pth
```
### Datasets
This study uses the open-source ImageCHD dataset to evaluate the performance of MIST architecture in left atrium (LA) segmentation. You can access open-source ImageCHD dataset through https://www.kaggle.com/datasets/xiaoweixumedicalai/imagechd
- Uses 2D axial slices with LA labels extracted from 3D ImageCHD volumes.
- Voxel spacing: 0.25 × 0.25 mm.
- HD95 was computed in pixel units and converted to millimeters by multiplying by 0.25.
